package com.csist.server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.List;
import java.util.Vector;

/**
 * 聊天室服务器端
 * 
 * @author Administrator
 *
 */
public class ChatServer {
	static List<Socket> sockets=new Vector<>();

	public static void main(String[] args) {
		ServerSocket server=null;
		try {
			server=new ServerSocket(8888);
			System.out.println("服务器端启动...");
			while(true){
				Socket socket=server.accept();
				System.out.println("有客户端连接...");

				sockets.add(socket);
				
				new ServerThread(socket).start();
			}
			
		} catch (IOException e) {
			e.printStackTrace();
		}

	}
}
